Add support for host coverage. The --host flag will pull coverage results from the host output rather than the target. Change-Id: I88aac17d23feff22926fbb67416ade3c821b5b6c
diff --git a/scripts/acov b/scripts/acov index ef7c86a..c33ede2 100755 --- a/scripts/acov +++ b/scripts/acov
@@ -36,11 +36,22 @@ sudo apt-get install lcov fi +HOST=false +ANDROID_OUT=$ANDROID_PRODUCT_OUT +if [ "$1" = "--host" ]; then + HOST=true + ANDROID_OUT=$ANDROID_HOST_OUT +fi + cd $ANDROID_BUILD_TOP FILE=cov.info DIR=$(mktemp -d covreport-XXXXXX) -adb pull /data/local/tmp/gcov -lcov -c -d $ANDROID_PRODUCT_OUT -o $DIR/$FILE + +if [ "$HOST" = "false" ]; then + adb pull /data/local/tmp/gcov +fi + +lcov -c -d $ANDROID_OUT -o $DIR/$FILE echo "Generating coverage report at $DIR" genhtml -q -o $DIR $DIR/$FILE xdg-open $DIR/index.html >/dev/null